function joinPaths(str1,str2) {
    let p = str1 + '/' + str2;
    p = p.replace(/\\/g, '/');
    p = p.replace(/\/+/g, '/');
    const parts = p.split('/');
    const find = [];
    for(const part of parts) {
        if(part === '..') {
            find.pop();
        } else if (part !== '.') {
            find.push(part)
        }
    }
    return find.join('/')
}
console.log(joinPaths('./a/b/c', '../d/e/f'))
const a = [];